import 'package:flutter/material.dart';
import 'package:flutter_application_1/models/video_model.dart';

import 'avatar_role_name.dart';
import 'comment_like_read.dart';

class TinyVideoCard extends StatelessWidget {
  final VideoItem videoItem;
  const TinyVideoCard({Key? key, required this.videoItem}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        AspectRatio(
          aspectRatio: 9 / 16,
          child: Stack(
            fit: StackFit.expand,
            children: [
              ClipRRect(
                borderRadius: BorderRadius.circular(10),
                child: FadeInImage.assetNetwork(
                  placeholder: "assets/images/common/lazy-3.png",
                  image: videoItem.coverPictureUrl,
                  fit: BoxFit.cover,
                ),
              ),
              Center(
                child: Image.asset(
                  "assets/images/icons/play_plus.png",
                  width: 38,
                  height: 38,
                ),
              ),
            ],
          ),
        ),
        Padding(
          padding: const EdgeInsets.symmetric(vertical: 8),
          child: AvatarRoleName(
            coverPictureUrl: videoItem.user.coverPictureUrl,
            nickname: videoItem.user.nickname,
            type: videoItem.user.type,
          ),
        ),
        CommentLikeRead(
          commentCount: videoItem.commentCount + 1000000,
          thumbUpCount: videoItem.thumbUpCount + 3200000,
          readCount: videoItem.readCount,
        ),
      ],
    );
  }
}
